package com.zj.system.controller;

import com.seventh.common.pojo.R;
import com.zj.system.pojo.vo.RoleVo;
import com.zj.system.pojo.vo.UserVo;
import com.zj.system.service.MenuSer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: clms-seventh
 * @description: 左侧动态导航栏的控制层
 * @author: 张静
 * @create: 2021-07-18 20:30
 **/
@RestController

@RequestMapping("system/menu")
public class MenuController {
    @Autowired
    private MenuSer menuSer;
    @GetMapping("selFunction")
    public R menu(){
        return menuSer.selectFunction();
    }
    @GetMapping("sel/{roleId}")
    public R selRole(@PathVariable("roleId") Integer roleId){
        return menuSer.fenFunction(roleId);
    }
    @GetMapping("insMenu/{roleId}")
    public R insertRole(@PathVariable("roleId") Integer roleId,
                        @RequestParam List<Integer> roleMenus){
        return menuSer.upMenu(roleId, roleMenus);
    }

}
